import { service as request, serviceModel as requestModel } from '@/utils/request_web'

// 获取文种类别
export function getPaperClassify() {
  return request({
    url: `/Work/PaperClassify/`,
    method: 'get'
  })
}
// 获取公文列表
export function getDocumentList() {
  return request({
    url: `/Work/Papers/`,
    method: 'get'
  })
}
// 获取公文列表
export function getPagerById(id) {
  return request({
    url: `/Work/Papers/${id}`,
    method: 'get'
  })
}
// 获取文档目录列表
export function queryFileCatalogList(params) {
  return request({
    url: `/File/catalog/`,
    method: 'get',
    params
  })
}
// 创建文档目录
export function createFileCatalog(data) {
  return request({
    url: `/File/catalog/`,
    method: 'post',
    data
  })
}
// 删除文档目录
export function deleteFileCatalog(id) {
  return request({
    url: `/File/catalog/${id}/`,
    method: 'DELETE'
  })
}
// 修改文档目录
export function updateFileCatalog(id, data) {
  return request({
    url: `/File/catalog/${id}/`,
    method: 'PATCH',
    data
  })
}
// 获取任务中心文档列表
export function queryTaskCenterFileList(params) {
  return request({
    url: `/Work/Files/`,
    method: 'get',
    params
  })
}
// 更新文件信息
export function updateFileInfo(id, data) {
  return request({
    url: `/Work/Files/${id}/`,
    method: 'patch',
    data
  })
}
// 删除任务中心文档
export function deleteTaskCenterFile(id) {
  return request({
    url: `/Work/Files/${id}/`,
    method: 'DELETE',
  })
}
// 删除任务中心文档
export function updateTaskCenterFile(id, data) {
  return request({
    url: `/Work/Files/${id}/`,
    method: 'PATCH',
    data
  })
}
// 获取共享中心、我的共享目录列表
export function queryShareFileList(params) {
  return request({
    url: `/File/share/`,
    method: 'get',
    params
  })
}
// 发送指定分享
export function postAppointShare(data) {
  return request({
    url: `/File/appoint_share/`,
    method: 'post',
    data
  })
}
